const router = new require("@koa/router")({prefix:"/group"});
const { auth } = require("../middleware/auth")
const {
    get_groups,
    get_group,
    add_group_member,
    add_group
} = require("../controller/group_controller")
const {
    get_groups_validator,
    get_group_validator,
    add_group_member_validator,
    add_group_validator
} = require("../validate/group_validator")
/**
 * 获取当前登录用户群组
 */
router.get("/get_groups",auth,get_groups_validator,get_groups)

/**
 * 根据群号查询一个群
 */
router.get("/get_group",auth,get_group_validator,get_group)

/**
 * 添加群组成员
 */
router.post("/add_group_member",auth,add_group_member_validator,add_group_member)

/**
 * 创建一个群组
 */
router.post("/add_group",auth,add_group_validator,add_group)

module.exports = router;